package bma.common.langutil.objrouter.impl;

import java.util.Map;

import bma.common.langutil.objrouter.ObjRouter;
import bma.common.langutil.objrouter.ObjRouterRunnable;

public abstract class BaseObjRouter implements ObjRouter{
	
	@SuppressWarnings("unchecked")
	@Override
	public <TYPE, RTYPE> RTYPE execute(ObjRouterRunnable<TYPE,RTYPE> runnable,
			Map<String, Object> options) {
		TYPE object = (TYPE) dispath(options);
		return runnable.run(object, options);
	}

	public abstract Object dispath(Map<String, Object> options);

	
}
